Patterns of consistency. Let’s image the most common covariance matrices.

covmat=readRDS("../Data/covmatAug13withED.rds")
pis=readRDS("../Data/pisAug13withED.rds")$pihat
z.stat=read.table("../Data/maxz.txt")
pi.mat=matrix(pis,ncol=54,byrow=T)

barplot(t(as.matrix(colSums(pi.mat))),names=c((paste0("K",seq(1:54)))),las=2,cex.names=0.5,main="PiHat")

We can see that there is lots of loading on the denoised matrices.

order(colSums(pi.mat),decreasing = T)
##  [1]  3  2  5  8  4 54  9 43 27 50 36 49 28 38 39 37 53 32 47  7  6 12 52
## [24] 34 40 44 42 46 35 41 48 31 51 29 15 23 26 30 19 33 22 14 11 45 18 13
## [47] 10 16 20 24 17 21 25  1

We can see that just 5 matrices appear to receive the majority of the prior weight ( 0.9149538) .

(important=order(colSums(pi.mat),decreasing = T)[1:10])
##  [1]  3  2  5  8  4 54  9 43 27 50

We can see that the first and most important matrix shows highly correlated genetic effects in brain and that the largest effects are correspondingly also seen in brain:

k=3
colnames(z.stat)[order(diag(covmat[[k]]),decreasing = TRUE)][1:10]
##  [1] "Brain_Cerebellum"                     
##  [2] "Brain_Cerebellar_Hemisphere"          
##  [3] "Brain_Cortex"                         
##  [4] "Brain_Caudate_basal_ganglia"          
##  [5] "Brain_Frontal_Cortex_BA9"             
##  [6] "Brain_Nucleus_accumbens_basal_ganglia"
##  [7] "Nerve_Tibial"                         
##  [8] "Adipose_Subcutaneous"                 
##  [9] "Artery_Tibial"                        
## [10] "Cells_Transformed_fibroblasts"
barplot(sort(diag(covmat[[k]])/max(diag(covmat[[k]])),decreasing=TRUE),names=colnames(z.stat)[order(diag(covmat[[k]]),decreasing=TRUE)],las=2,col=c(rep("green",11),rep("orange",11),rep("magenta",11),rep("red",11)),main=paste0("PriorEffectSizeUk",k),cex.names = .5)

I’ve colored the sizes by those tissues in each quartile.

normdag=(diag(covmat[[3]])/max(diag(covmat[[3]])))
quantile(normdag)
##         0%        25%        50%        75%       100% 
## 0.08769782 0.22585547 0.36293678 0.57340044 1.00000000
name.order=colnames(z.stat)[order(diag(covmat[[3]]),decreasing=T)]
name.order[1:10]
##  [1] "Brain_Cerebellum"                     
##  [2] "Brain_Cerebellar_Hemisphere"          
##  [3] "Brain_Cortex"                         
##  [4] "Brain_Caudate_basal_ganglia"          
##  [5] "Brain_Frontal_Cortex_BA9"             
##  [6] "Brain_Nucleus_accumbens_basal_ganglia"
##  [7] "Nerve_Tibial"                         
##  [8] "Adipose_Subcutaneous"                 
##  [9] "Artery_Tibial"                        
## [10] "Cells_Transformed_fibroblasts"

While in the second most important U_k, Uk=2, the brains have the smallest prior effect size.

colnames(z.stat)[order(diag(covmat[[2]]),decreasing = TRUE)][1:10]
##  [1] "Cells_Transformed_fibroblasts" "Thyroid"                      
##  [3] "Nerve_Tibial"                  "Adipose_Subcutaneous"         
##  [5] "Skin_Sun_Exposed_Lower_leg"    "Artery_Tibial"                
##  [7] "Muscle_Skeletal"               "Whole_Blood"                  
##  [9] "Esophagus_Mucosa"              "Lung"
k=2
barplot(sort(diag(covmat[[k]])/max(diag(covmat[[k]])),decreasing=TRUE),names=colnames(z.stat)[order(diag(covmat[[k]]),decreasing=TRUE)],las=2,col=c(rep("green",11),rep("orange",11),rep("magenta",11),rep("red",11)),main=paste0("PriorEffectSizeUk",k),cex.names = 0.5)

And in \(U_k=4\) and \(U_k=8\), we see some tissue specific effects:

k=4
barplot(sort(diag(covmat[[k]])/max(diag(covmat[[k]])),decreasing=TRUE),names=colnames(z.stat)[order(diag(covmat[[k]]),decreasing=TRUE)],las=2,col=c(rep("green",11),rep("orange",11),rep("magenta",11),rep("red",11)),main=paste0("PriorEffectSizeUk",k),cex.names = 0.5)

k=8
barplot(sort(diag(covmat[[k]])/max(diag(covmat[[k]])),decreasing=TRUE),names=colnames(z.stat)[order(diag(covmat[[k]]),decreasing=TRUE)],las=2,col=c(rep("green",11),rep("orange",11),rep("magenta",11),rep("red",11)),main=paste0("PriorEffectSizeUk",k),cex.names = 0.5)

We can see that in all the common matrices, the patterns of correlation among tissue are distinct, but brains seem consistently correalted even though occasionally they may have large or small prior effects, as reflected on the diagonal of the covariance matrix \(U_{k}\).

We can see that as expected, for the single rank matrices 5 8 and 4,the effects in one tissue perfectly predict their effect in another tissue, and accordingly the correlation is either -1 or 1. However, the non-single rank matrices that are most important - matrices 3 and 2 - more subtle intermediate levels of correlation of effect are present.

We can segregate the tissues by their relative importance on the diagonal of the top two covariance matrices.

order1=colnames(z.stat)[order(diag(covmat[[3]]),decreasing=TRUE)]
order2=colnames(z.stat)[order(diag(covmat[[2]]),decreasing=TRUE)]


index=rep(0,44)
for(r in 1:length(colnames(z.stat))){tissue=colnames(z.stat)[r];index[r]=which(order1==tissue)}

index2=rep(0,44)
for(r in 1:length(colnames(z.stat))){tissue=colnames(z.stat)[r];index2[r]=which(order2==tissue)}

plot(index,index2,main="Rank of Prior Variance in UK=2 vs Rank of Prior Variance in Uk=3",xlab="Rank in Uk=3",ylab="Rank in Uk=2")
 text(index,index2,colnames(z.stat),cex=0.5)

plot(diag(covmat[[3]])/max(diag(covmat[[3]])),diag(covmat[[2]])/max(diag(covmat[[2]])),main="Prior variance in Uk2 vs Prior Variance in Uk3",xlab="Prior variance in Uk3",ylab="Prior Variance in Uk=2")
text(diag(covmat[[3]])/max(diag(covmat[[3]])),diag(covmat[[2]])/max(diag(covmat[[2]])),colnames(z.stat),cex=0.5)